#include "EquationSolver.h"
#include <iostream>
#include <cmath>
//#define M_PI 3.14159265358979323846


double Function :: operator()(double _x)
{
    return (pow(_x,3)-12*pow(_x,2)+3*_x+1);
}
double Function :: diff(double _x)
{
    return 0;//割线法不需要用到导数，设置返回0
};

int main()
{
    Function func;
    Secant sec(0, -0.5, 0.00001, 100, func);
    std::cout << sec.solve() << std::endl;
    return 0;
};